home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / pxfsetsid.z / pxfsetsid
Encoding:
Text File  |  1998-10-30  |  3.7 KB  |  85 lines

  1. PXFSETSID(3F)                                          Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFSSEETTSSIIDD - Creates a new session for a calling process
  6.  
  7. SSYYNNOOPPSSIISS
  8.      SSUUBBRROOUUTTIINNEE PPXXFFSSEETTSSIIDD ((_i_s_i_d,, _i_e_r_r_o_r))
  9.      IINNTTEEGGEERR _i_s_i_d,, _i_e_r_r_o_r
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, and IRIX systems
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  16.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  17.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  18.      7.2 F77 compiler.
  19.  
  20.      The PPXXFFSSEETTSSIIDD routine uses the sseettssiidd(2) system call to create a new
  21.      session for the calling process. The calling process must not be the
  22.      process leader for PPXXFFSSEETTSSIIDD to be successful.
  23.  
  24.      After the successful completion of PPXXFFSSEETTSSIIDD, the calling process will
  25.      be the session leader for the new session and the process group leader
  26.      for the new process group. The calling process also will have no
  27.      controlling terminal.
  28.  
  29.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  30.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  31.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  32.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  33.      IRIX, the default kind is KKIINNDD==44.
  34.  
  35.      The following is a list of arguments for this routine:
  36.  
  37.      _i_s_i_d      An output integer variable for the new process group ID of
  38.                the calling process.
  39.  
  40.      _i_e_r_r_o_r    An output integer variable that contains zero if PPXXFFSSEETTSSIIDD
  41.                was successful or nonzero if PPXXFFSSEETTSSIIDD was not successful.
  42.  
  43.      This routine may return the EEPPEERRMM error value if the calling process
  44.      is already a process group leader, or the calling process group ID of
  45.      a process other than the calling process matches the process ID of the
  46.      calling process.
  47.  
  48. EEXXAAMMPPLLEESS
  49.      In this example, PPXXFFFFOORRKK(3F) is called to create a child process,
  50.      which calls PPXXFFSSEETTSSIIDD to create a new session. The child writes the
  51.      value of _i_e_r_r_o_r to Fortran unit 10 and stops. After the fork, the
  52.      parent process waits for the child to finish execution, and then reads
  53.      from Fortran unit 10. If the value read in from unit 10 is not equal
  54.      to zero, the child's call to PPXXFFSSEETTSSIIDD was unsucessful.
  55.  
  56.           program pxftest
  57.           integer isid, iretpid, istat, ierror, i
  58.  
  59.           CALL PXFFORK(iretpid,ierror)
  60.           if (ierror .ne. 0) then
  61.              print *,'FAILED: PXFFORK call with error = ',ierror
  62.           else
  63.              if (iretpid .eq. 0) then
  64.                 CALL PXFSETSID(isid, ierror)
  65.                 write (10,*) ierror
  66.                 stop
  67.              else
  68.                 CALL PXFWAIT(istat, iretpid, ierror)
  69.                 read (10,*) i
  70.                 if (i .eq. 0) then
  71.                    print *,'PASSED: PXFSETSID call under normal conditions'
  72.                 else
  73.                    print *,'FAILED: PXFSETSID call with error = ',i
  74.                 endif
  75.              endif
  76.           endif
  77.  
  78. SSEEEE AALLSSOO
  79.      sseettssiidd(2)
  80.      PPXXFFFFOORRKK(3F)
  81.  
  82.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-
  83.      2165, for the printed version of this man page.
  84.  
  85.